package com.spring.extjs.controller;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.spring.extjs.pageModel.ApplicationInfo;
import com.spring.extjs.service.IApplicationService;

@Controller
@RequestMapping("/app")
public class ApplicationController {

	Logger logger = LoggerFactory.getLogger(UserController.class);
	
	@Autowired
	private IApplicationService applicationService;
	
	/**
	 * 浏览器可以通过两种方式来请求这个方法： 
	 * 		/app/applicationinfo.do
	 * 		/rest/app/applicationinfo
	 * @param request
	 * @return
	 */
	@RequestMapping("/applicationinfo")  
    public synchronized @ResponseBody ApplicationInfo getApplicationInfo(HttpServletRequest request) {  
		
        return applicationService.getApplicationInfo();  
    }
}
